home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / meadows.c < prev    next >
C/C++ Source or Header  |  2000-05-13  |  20KB  |  631 lines

  1. /***************************************************************************
  2.     meadows.c
  3.     Machine driver
  4.     Dead Eye, Gypsy Juggler
  5.  
  6.     J. Buchmueller, June '98
  7.  
  8.     ***********************************************
  9.     memory map CPU #0 (preliminary)
  10.     ***********************************************
  11.  
  12.     0000..0bff    ROM part one
  13.  
  14.     0c00..0c03    H/W input ports
  15.     -----------------------------------------------
  16.             0 R control buttons
  17.                 D0        button 1
  18.                 D1        start 2 player game
  19.  
  20.             1 R analog control
  21.                 D0-D7    center is 0x7f
  22.             2 R horizontal sync divider chain
  23.                 D7 9.765kHz ... D0 2.5MHz
  24.             3 R dip switch settings
  25.                 D0-D2    select 2 to 9 coins
  26.                 D3-D4    Coins per play D3 D4
  27.                         1 coin    1 play    0  0
  28.                         2 coins 1 play    1  0
  29.                         1 coin    2 plays 0  1
  30.                         free play        1  1
  31.                 D5        Attact music 0:off, 1:on
  32.                 D6-D7    Extended play  D6 D7
  33.                         none            0  0
  34.                         5000 pts        1  0
  35.                         15000 pts        0  1
  36.                         35000 pts        1  1
  37.  
  38.     0d00-0d0f    H/W sprites
  39.     -----------------------------------------------
  40.             0 W D0-D7    sprite 0 horz
  41.             1 W D0-D7     sprite 1 horz
  42.             2 W D0-D7     sprite 2 horz
  43.             3 W D0-D7     sprite 3 horz
  44.             4 W D0-D7     sprite 0 vert
  45.             5 W D0-D7     sprite 2 vert
  46.             6 W D0-D7     sprite 3 vert
  47.             7 W D0-D7     sprite 4 vert
  48.             8 W D0-D7     sprite 0 select
  49.                 D0-D3     sprite #
  50.                 D4         prom (not sure)
  51.                 D5         flip x
  52.             9 W          sprite 1 select
  53.                 D0-D3     sprite #
  54.                 D4         prom (not sure)
  55.                 D5         flip x
  56.             a W          sprite 2 select
  57.                 D0-D3     sprite #
  58.                 D4         prom (not sure)
  59.                 D5         flip x
  60.             b W          sprite 3 select
  61.                 D0-D3     sprite #
  62.                 D4         prom (not sure)
  63.                 D5         flip x
  64.  
  65.     0e00-0eff    RAM
  66.  
  67.     1000-1bff    ROM     part two
  68.  
  69.     1c00-1fff    RAM     video buffer
  70.  
  71.     ***********************************************
  72.     memory map CPU #1 (preliminary)
  73.     ***********************************************
  74.  
  75.     0000..0bff    ROM part one
  76.  
  77.     0c00..0c03    H/W input ports
  78.     -----------------------------------------------
  79.             0 R sound command from CPU #0
  80.                 D0-D7    8 different sounds ???
  81.  
  82.             1 R ???
  83.             2 R ???
  84.             3 R ???
  85.  
  86.             0 W D0-D7   DAC
  87.             1 W D0-D3   preset for counter, clk is 5 MHz / 256
  88.                 D4-D7    volume bits 0 .. 3 (bit 4 is CPU #1 flag output)
  89.             2 W D0-D7   preset for counter, clk is 5 MHz / 32
  90.             3 W D0      divide c02 counter by 0: 2, 1: 4
  91.                 D1        sound enable for c02 tone generator
  92.                 D2      sound enable for DAC
  93.                 D3        sound enable for c01 tone generator
  94.  
  95.     0e00-0eff    RAM
  96.  
  97.  
  98.  
  99.  
  100. ***************************************************************************/
  101.  
  102. #include "driver.h"
  103. #include "vidhrdw/generic.h"
  104.  
  105. /*************************************************************/
  106. /*                                                           */
  107. /* Externals                                                 */
  108. /*                                                           */
  109. /*************************************************************/
  110. int deadeye_vh_start(void);
  111. int gypsyjug_vh_start(void);
  112. void meadows_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  113. WRITE_HANDLER( meadows_videoram_w );
  114. WRITE_HANDLER( meadows_sprite_w );
  115.  
  116. int meadows_sh_start(const struct MachineSound *msound);
  117. void meadows_sh_stop(void);
  118. void meadows_sh_dac_w(int data);
  119. void meadows_sh_update(void);
  120. extern unsigned char meadows_0c00;
  121. extern unsigned char meadows_0c01;
  122. extern unsigned char meadows_0c02;
  123. extern unsigned char meadows_0c03;
  124.  
  125.  
  126. /*************************************************************/
  127. /*                                                           */
  128. /* Statics                                                   */
  129. /*                                                           */
  130. /*************************************************************/
  131. static  unsigned char flip_bits[0x100] = {
  132.     0x00,0x80,0x40,0xc0,0x20,0xa0,0x60,0xe0,0x10,0x90,0x50,0xd0,0x30,0xb0,0x70,0xf0,
  133.     0x08,0x88,0x48,0xc8,0x28,0xa8,0x68,0xe8,0x18,0x98,0x58,0xd8,0x38,0xb8,0x78,0xf8,
  134.     0x04,0x84,0x44,0xc4,0x24,0xa4,0x64,0xe4,0x14,0x94,0x54,0xd4,0x34,0xb4,0x74,0xf4,
  135.     0x0c,0x8c,0x4c,0xcc,0x2c,0xac,0x6c,0xec,0x1c,0x9c,0x5c,0xdc,0x3c,0xbc,0x7c,0xfc,
  136.     0x02,0x82,0x42,0xc2,0x22,0xa2,0x62,0xe2,0x12,0x92,0x52,0xd2,0x32,0xb2,0x72,0xf2,
  137.     0x0a,0x8a,0x4a,0xca,0x2a,0xaa,0x6a,0xea,0x1a,0x9a,0x5a,0xda,0x3a,0xba,0x7a,0xfa,
  138.     0x06,0x86,0x46,0xc6,0x26,0xa6,0x66,0xe6,0x16,0x96,0x56,0xd6,0x36,0xb6,0x76,0xf6,
  139.     0x0e,0x8e,0x4e,0xce,0x2e,0xae,0x6e,0xee,0x1e,0x9e,0x5e,0xde,0x3e,0xbe,0x7e,0xfe,
  140.     0x01,0x81,0x41,0xc1,0x21,0xa1,0x61,0xe1,0x11,0x91,0x51,0xd1,0x31,0xb1,0x71,0xf1,
  141.     0x09,0x89,0x49,0xc9,0x29,0xa9,0x69,0xe9,0x19,0x99,0x59,0xd9,0x39,0xb9,0x79,0xf9,
  142.     0x05,0x85,0x45,0xc5,0x25,0xa5,0x65,0xe5,0x15,0x95,0x55,0xd5,0x35,0xb5,0x75,0xf5,
  143.     0x0d,0x8d,0x4d,0xcd,0x2d,0xad,0x6d,0xed,0x1d,0x9d,0x5d,0xdd,0x3d,0xbd,0x7d,0xfd,
  144.     0x03,0x83,0x43,0xc3,0x23,0xa3,0x63,0xe3,0x13,0x93,0x53,0xd3,0x33,0xb3,0x73,0xf3,
  145.     0x0b,0x8b,0x4b,0xcb,0x2b,0xab,0x6b,0xeb,0x1b,0x9b,0x5b,0xdb,0x3b,0xbb,0x7b,0xfb,
  146.     0x07,0x87,0x47,0xc7,0x27,0xa7,0x67,0xe7,0x17,0x97,0x57,0xd7,0x37,0xb7,0x77,0xf7,
  147.     0x0f,0x8f,0x4f,0xcf,0x2f,0xaf,0x6f,0xef,0x1f,0x9f,0x5f,0xdf,0x3f,0xbf,0x7f,0xff,
  148. };
  149. static int cycles_at_vsync = 0;
  150.  
  151. /*************************************************************/
  152. /*                                                           */
  153. /* Hardware read/write from the main CPU                     */
  154. /*                                                           */
  155. /*************************************************************/
  156. READ_HANDLER( meadows_hardware_r )
  157. {
  158.     switch( offset ) {
  159.         case 0: /* buttons */
  160.             return input_port_0_r(0);
  161.         case 1: /* AD stick */
  162.             return input_port_1_r(0);
  163.         case 2: /* horizontal sync divider chain */
  164.             return flip_bits[(cycles_currently_ran() - cycles_at_vsync) & 0xff];
  165.         case 3: /* dip switches */
  166.             return input_port_2_r(0);
  167.     }
  168.     return 0;
  169. }
  170.  
  171. WRITE_HANDLER( meadows_hardware_w )
  172. {
  173.     switch( offset ) {
  174.         case 0:
  175.             if (meadows_0c00 == data)
  176.                 break;
  177.             logerror("meadows_hardware_w %d $%02x\n", offset, data);
  178.             meadows_0c00 = data;
  179.             break;
  180.         case 1:
  181.             logerror("meadows_hardware_w %d $%02x\n", offset, data);
  182.             break;
  183.         case 2:
  184.             logerror("meadows_hardware_w %d $%02x\n", offset, data);
  185.             break;
  186.         case 3:
  187. //            S2650_Clear_Pending_Interrupts();
  188.             break;
  189.     }
  190. }
  191.  
  192. /*************************************************************/
  193. /*                                                           */
  194. /* Interrupt for the main cpu                                */
  195. /*                                                           */
  196. /*************************************************************/
  197. int     meadows_interrupt(void)
  198. {
  199. static  int sense_state = 0;
  200. static    int coin1_state = 0;
  201.     /* preserve the actual cycle count */
  202.     cycles_at_vsync = cycles_currently_ran();
  203.     /* fake something toggling the sense input line of the S2650 */
  204.     sense_state ^= 1;
  205.     cpu_set_irq_line( 0, 1, (sense_state) ? ASSERT_LINE : CLEAR_LINE);
  206.     if( input_port_3_r(0) & 0x01 ) {
  207.         if( !coin1_state ) {
  208.             coin1_state = 1;
  209.             /* S2650 interrupt vector */
  210.             cpu_irq_line_vector_w(0,0,0x82);
  211.             cpu_set_irq_line(0,0,PULSE_LINE);
  212.         }
  213.     }
  214.     coin1_state = 0;
  215.     return ignore_interrupt();
  216. }
  217.  
  218. /*************************************************************/
  219. /*                                                           */
  220. /* Hardware read/write for the sound CPU                     */
  221. /*                                                           */
  222. /*************************************************************/
  223. static WRITE_HANDLER( sound_hardware_w )
  224. {
  225.     switch( offset & 3 ) {
  226.         case 0: /* DAC */
  227.             meadows_sh_dac_w(data ^ 0xff);
  228.             break;
  229.         case 1: /* counter clk 5 MHz / 256 */
  230.             if (data == meadows_0c01)
  231.                 break;
  232.             logerror("sound_w ctr1 preset $%x amp %d\n", data & 15, data >> 4);
  233.             meadows_0c01 = data;
  234.             meadows_sh_update();
  235.             break;
  236.         case 2: /* counter clk 5 MHz / 32 (/ 2 or / 4) */
  237.             if (data == meadows_0c02)
  238.                 break;
  239.             logerror("sound_w ctr2 preset $%02x\n", data);
  240.             meadows_0c02 = data;
  241.             meadows_sh_update();
  242.             break;
  243.         case 3: /* sound enable */
  244.             if (data == meadows_0c03)
  245.                 break;
  246.             logerror("sound_w enable ctr2/2:%d ctr2:%d dac:%d ctr1:%d\n", data&1, (data>>1)&1, (data>>2)&1, (data>>3)&1);
  247.             meadows_0c03 = data;
  248.             meadows_sh_update();
  249.             break;
  250.     }
  251. }
  252.  
  253. static READ_HANDLER( sound_hardware_r )
  254. {
  255.     int data = 0;
  256.  
  257.     switch( offset ) {
  258.         case 0:
  259.             data = meadows_0c00;
  260. #if VERBOSE
  261.             {
  262.                 static int last_data = 0;
  263.                 if (data != last_data) {
  264.                     last_data = data;
  265.                     logerror("sound_r %d $%02x\n", offset, data);
  266.                 }
  267.             }
  268. #endif
  269.             break;
  270.         case 1: break;
  271.         case 2: break;
  272.         case 3: break;
  273.     }
  274.     return data;
  275. }
  276.  
  277. /*************************************************************/
  278. /*                                                           */
  279. /* Interrupt for the sound cpu                               */
  280. /*                                                           */
  281. /*************************************************************/
  282. static int sound_interrupt(void)
  283. {
  284.     static    int sense_state = 0;
  285.  
  286.     /* fake something toggling the sense input line of the S2650 */
  287.     sense_state ^= 1;
  288.     cpu_set_irq_line( 1, 1, (sense_state) ? ASSERT_LINE : CLEAR_LINE );
  289.     return ignore_interrupt();
  290. }
  291.  
  292. /*************************************************************/
  293. /*                                                           */
  294. /* Memory layout                                             */
  295. /*                                                           */
  296. /*************************************************************/
  297. static struct MemoryWriteAddress writemem[] =
  298. {
  299.     { 0x0000, 0x0bff, MWA_ROM },
  300.     { 0x0c00, 0x0c03, meadows_hardware_w },
  301.     { 0x0d00, 0x0d0f, meadows_sprite_w },
  302.     { 0x0e00, 0x0eff, MWA_RAM },
  303.     { 0x1000, 0x1bff, MWA_ROM },
  304.     { 0x1c00, 0x1fff, meadows_videoram_w, &videoram, &videoram_size },
  305.     { -1 }    /* end of table */
  306. };
  307.  
  308. static struct MemoryReadAddress readmem[] =
  309. {
  310.     { 0x0000, 0x0bff, MRA_ROM },
  311.     { 0x0c00, 0x0c03, meadows_hardware_r },
  312.     { 0x0e00, 0x0eff, MRA_RAM },
  313.     { 0x1000, 0x1bff, MRA_ROM },
  314.     { 0x1c00, 0x1fff, MRA_RAM },
  315.     { -1 }    /* end of table */
  316. };
  317.  
  318. static struct MemoryWriteAddress sound_writemem[] =
  319. {
  320.     { 0x0000, 0x0bff, MWA_ROM },
  321.     { 0x0c00, 0x0c03, sound_hardware_w },
  322.     { 0x0e00, 0x0eff, MWA_RAM },
  323.     { -1 }    /* end of table */
  324. };
  325.  
  326. static struct MemoryReadAddress sound_readmem[] =
  327. {
  328.     { 0x0000, 0x0bff, MRA_ROM },
  329.     { 0x0c00, 0x0c03, sound_hardware_r },
  330.     { 0x0e00, 0x0eff, MRA_RAM },
  331.     { -1 }    /* end of table */
  332. };
  333.  
  334. INPUT_PORTS_START( meadows )
  335.     PORT_START        /* IN0 buttons */
  336.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
  337.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START1  )
  338.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  339.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  340.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  341.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  342.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  343.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  344.  
  345.     PORT_START        /* IN1 control 1 */
  346.     PORT_ANALOG( 0xff, 0x80, IPT_AD_STICK_X, 100, 10, 0x10, 0xf0 )
  347.  
  348.     PORT_START        /* IN2 dip switch */
  349.     PORT_DIPNAME( 0x07, 0x01, DEF_STR( Lives ) )
  350.     PORT_DIPSETTING(    0x00, "2" )
  351.     PORT_DIPSETTING(    0x01, "3" )
  352.     PORT_DIPSETTING(    0x02, "4" )
  353.     PORT_DIPSETTING(    0x03, "5" )
  354.     PORT_DIPSETTING(    0x04, "6" )
  355.     PORT_DIPSETTING(    0x05, "7" )
  356.     PORT_DIPSETTING(    0x06, "8" )
  357.     PORT_DIPSETTING(    0x07, "9" )
  358.     PORT_DIPNAME( 0x18, 0x00, DEF_STR( Coinage ) )
  359.     PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
  360.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  361.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
  362.     PORT_DIPSETTING(    0x18, DEF_STR( Free_Play ) )
  363.     PORT_DIPNAME( 0x20, 0x20, "Demo Sounds?" )
  364.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  365.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  366.     PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Bonus_Life ) )
  367.     PORT_DIPSETTING(    0x40, "5000")
  368.     PORT_DIPSETTING(    0x80, "15000")
  369.     PORT_DIPSETTING(    0xc0, "35000")
  370.     PORT_DIPSETTING(    0x00, "None")
  371.  
  372.     PORT_START        /* FAKE coinage */
  373.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  374.     PORT_BIT( 0x8e, IP_ACTIVE_LOW, IPT_UNUSED )
  375. INPUT_PORTS_END
  376.  
  377. static struct GfxLayout charlayout =
  378. {
  379.     8,8,                            /* 8*8 characters */
  380.     128,                            /* 128 characters ? */
  381.     1,                                /* 1 bit per pixel */
  382.     { 0 },                            /* no bitplanes */
  383.     { 0, 1, 2, 3, 4, 5, 6, 7 },     /* pretty straight layout */
  384.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  385.     8*8                             /* every char takes 8 bytes */
  386. };
  387.  
  388. static struct GfxLayout spritelayout =
  389. {
  390.     16,16,                            /* 16*16 sprites ?    */
  391.     32,                             /* 32 sprites  */
  392.     1,                                /* 1 bits per pixel */
  393.     { 0 },                            /* 1 bitplane */
  394.     { 0, 1, 2, 3, 4, 5, 6, 7,
  395.     8, 9,10,11,12,13,14,15 },      /* pretty straight layout */
  396.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
  397.     8*16, 9*16,10*16,11*16,12*16,13*16,14*16,15*16 },
  398.     16*2*8                            /* every sprite takes 32 bytes */
  399. };
  400.  
  401. static struct GfxDecodeInfo gfxdecodeinfo[] =
  402. {
  403.     { REGION_GFX1, 0, &charlayout,     0, 4 },        /* character generator */
  404.     { REGION_GFX2, 0, &spritelayout, 0, 4 },        /* sprite prom 1 */
  405.     { REGION_GFX3, 0, &spritelayout, 0, 4 },        /* sprite prom 2 */
  406.     { REGION_GFX4, 0, &spritelayout, 0, 4 },        /* sprite prom 3 (unused) */
  407.     { REGION_GFX5, 0, &spritelayout, 0, 4 },        /* sprite prom 4 (unused) */
  408.     { -1 } /* end of array */
  409. };
  410.  
  411. static unsigned char palette[] =
  412. {
  413.     0x00,0x00,0x00, /* BLACK */
  414.     0xff,0xff,0xff, /* WHITE */
  415. };
  416.  
  417. #define ARTWORK_COLORS (2 + 32768)
  418.  
  419. static unsigned short colortable[ARTWORK_COLORS] =
  420. {
  421.     0,0,
  422.     0,1,
  423. };
  424. static void init_palette(unsigned char *game_palette, unsigned short *game_colortable,const unsigned char *color_prom)
  425. {
  426.     memcpy(game_palette,palette,sizeof(palette));
  427.     memcpy(game_colortable,colortable,sizeof(colortable));
  428. }
  429.  
  430.  
  431. static struct DACinterface dac_interface =
  432. {
  433.     1,
  434.     { 100 }
  435. };
  436.  
  437. static struct CustomSound_interface custom_interface =
  438. {
  439.     meadows_sh_start,
  440.     meadows_sh_stop,
  441.     0
  442. };
  443.  
  444.  
  445.  
  446. static struct MachineDriver machine_driver_deadeye =
  447. {
  448.     /* basic machine hardware */
  449.     {
  450.         {
  451.             CPU_S2650,
  452.             625000,     /* 5MHz / 8 = 625 kHz */
  453.             readmem,writemem,0,0,
  454.             meadows_interrupt,1     /* one interrupt per frame!? */
  455.         },
  456.         {
  457.             CPU_S2650 | CPU_AUDIO_CPU,
  458.             625000,     /* 5MHz / 8 = 625 kHz */
  459.             sound_readmem,sound_writemem,
  460.             0,0,
  461.             0,0,
  462.             sound_interrupt,38    /* 5000000/131072 interrupts per frame */
  463.         }
  464.     },
  465.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  466.     10,                                     /* dual CPU; interleave them */
  467.     0,
  468.  
  469.     /* video hardware */
  470.     32*8, 30*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  471.     gfxdecodeinfo,
  472.     ARTWORK_COLORS,ARTWORK_COLORS,        /* Leave extra colors for the overlay */
  473.     init_palette,
  474.  
  475.     VIDEO_TYPE_RASTER | VIDEO_SUPPORTS_DIRTY | VIDEO_MODIFIES_PALETTE,
  476.     0,
  477.     deadeye_vh_start,
  478.     generic_vh_stop,
  479.     meadows_vh_screenrefresh,
  480.  
  481.     /* sound hardware */
  482.     0,0,0,0,
  483.     {
  484.         {
  485.             SOUND_DAC,
  486.             &dac_interface
  487.         },
  488.         {
  489.             SOUND_CUSTOM,
  490.             &custom_interface
  491.         }
  492.     }
  493. };
  494.  
  495. static struct MachineDriver machine_driver_gypsyjug =
  496. {
  497.     /* basic machine hardware */
  498.     {
  499.         {
  500.             CPU_S2650,
  501.             625000,     /* 5MHz / 8 = 625 kHz */
  502.             readmem,writemem,0,0,
  503.             meadows_interrupt,1     /* one interrupt per frame!? */
  504.         },
  505.         {
  506.             CPU_S2650 | CPU_AUDIO_CPU,
  507.             625000,     /* 5MHz / 8 = 625 kHz */
  508.             sound_readmem,sound_writemem,
  509.             0,0,
  510.             0,0,
  511.             sound_interrupt,38    /* 5000000/131072 interrupts per frame */
  512.         }
  513.     },
  514.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  515.     10,                                     /* dual CPU; interleave them */
  516.     0,
  517.  
  518.     /* video hardware */
  519.     32*8, 30*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  520.     gfxdecodeinfo,
  521.     ARTWORK_COLORS,ARTWORK_COLORS,        /* Leave extra colors for the overlay */
  522.     init_palette,
  523.  
  524.     VIDEO_TYPE_RASTER | VIDEO_SUPPORTS_DIRTY | VIDEO_MODIFIES_PALETTE,
  525.     0,
  526.     gypsyjug_vh_start,
  527.     generic_vh_stop,
  528.     meadows_vh_screenrefresh,
  529.  
  530.     /* sound hardware */
  531.     0,0,0,0,
  532.     {
  533.         {
  534.             SOUND_DAC,
  535.             &dac_interface
  536.         },
  537.         {
  538.             SOUND_CUSTOM,
  539.             &custom_interface
  540.         }
  541.     }
  542. };
  543.  
  544. /***************************************************************************
  545.  
  546.   Game driver(s)
  547.  
  548. ***************************************************************************/
  549.  
  550. ROM_START( deadeye )
  551.     ROM_REGION( 0x08000, REGION_CPU1 )     /* 32K for code */
  552.     ROM_LOAD( "de1.8h",       0x0000, 0x0400, 0xbd09e4dc )
  553.     ROM_LOAD( "de2.9h",       0x0400, 0x0400, 0xb89edec3 )
  554.     ROM_LOAD( "de3.10h",      0x0800, 0x0400, 0xacf24438 )
  555.     ROM_LOAD( "de4.11h",      0x1000, 0x0400, 0x8b68f792 )
  556.     ROM_LOAD( "de5.12h",      0x1400, 0x0400, 0x7bdb535c )
  557.     ROM_LOAD( "de6.13h",      0x1800, 0x0400, 0x847f9467 )
  558.  
  559.     ROM_REGION( 0x0400, REGION_GFX1 | REGIONFLAG_DISPOSE )
  560.     ROM_LOAD( "de_char.15e",  0x0000, 0x0400, 0xb032bd8d )
  561.  
  562.     ROM_REGION( 0x0400, REGION_GFX2 | REGIONFLAG_DISPOSE )
  563.     ROM_LOAD( "de_mov1.5a",   0x0000, 0x0400, 0xc046b4c6 )
  564.  
  565.     ROM_REGION( 0x0400, REGION_GFX3 | REGIONFLAG_DISPOSE )
  566.     ROM_LOAD( "de_mov2.13a",  0x0000, 0x0400, 0xb89c5df9 )
  567.  
  568.     ROM_REGION( 0x0400, REGION_GFX4 | REGIONFLAG_DISPOSE )
  569.     /* empty */
  570.     ROM_REGION( 0x0400, REGION_GFX5 | REGIONFLAG_DISPOSE )
  571.     /* empty */
  572.  
  573.     ROM_REGION( 0x08000, REGION_CPU2 )     /* 32K for code for the sound cpu */
  574.     ROM_LOAD( "de_snd",       0x0000, 0x0400, 0xc10a1b1a )
  575. ROM_END
  576.  
  577. ROM_START( gypsyjug )
  578.     ROM_REGION( 0x08000, REGION_CPU1 )     /* 32K for code */
  579.     ROM_LOAD( "gj.1b",        0x0000, 0x0400, 0xf6a71d9f )
  580.     ROM_LOAD( "gj.2b",        0x0400, 0x0400, 0x94c14455 )
  581.     ROM_LOAD( "gj.3b",        0x0800, 0x0400, 0x87ee0490 )
  582.     ROM_LOAD( "gj.4b",        0x1000, 0x0400, 0xdca519c8 )
  583.     ROM_LOAD( "gj.5b",        0x1400, 0x0400, 0x7d83f9d0 )
  584.  
  585.     ROM_REGION( 0x0400, REGION_GFX1 | REGIONFLAG_DISPOSE )
  586.     ROM_LOAD( "gj.e15",       0x0000, 0x0400, 0xadb25e13 )
  587.  
  588.     ROM_REGION( 0x0400, REGION_GFX2 | REGIONFLAG_DISPOSE )
  589.     ROM_LOAD( "gj.a",         0x0000, 0x0400, 0xd3725193 )
  590.  
  591.     ROM_REGION( 0x0400, REGION_GFX3 | REGIONFLAG_DISPOSE )
  592.     /* empty (copied from 2) */
  593.  
  594.     ROM_REGION( 0x0400, REGION_GFX4 | REGIONFLAG_DISPOSE )
  595.     /* empty (filled with fake data) */
  596.  
  597.     ROM_REGION( 0x0400, REGION_GFX5 | REGIONFLAG_DISPOSE )
  598.     /* empty (filled with fake data) */
  599.  
  600.     ROM_REGION( 0x08000, REGION_CPU2 )     /* 32K for code for the sound cpu */
  601.     ROM_LOAD( "gj.a4s",       0x0000, 0x0400, 0x17a116bc )
  602.     ROM_LOAD( "gj.a5s",       0x0400, 0x0400, 0xfc23ae09 )
  603.     ROM_LOAD( "gj.a6s",       0x0800, 0x0400, 0x9e7bd71e )
  604. ROM_END
  605.  
  606.  
  607.  
  608. /* A fake for the missing ball sprites #3 and #4 */
  609. static void init_gypsyjug(void)
  610. {
  611. int i;
  612. static unsigned char ball[16*2] = {
  613.     0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00,
  614.     0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00,
  615.     0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00,
  616.     0x01,0x80, 0x03,0xc0, 0x03,0xc0, 0x01,0x80};
  617.  
  618.     memcpy(memory_region(REGION_GFX3),memory_region(REGION_GFX2),memory_region_length(REGION_GFX3));
  619.  
  620.     for (i = 0; i < memory_region_length(REGION_GFX4); i += 16*2)
  621.     {
  622.         memcpy(memory_region(REGION_GFX4) + i, ball, sizeof(ball));
  623.         memcpy(memory_region(REGION_GFX5) + i, ball, sizeof(ball));
  624.     }
  625. }
  626.  
  627.  
  628.  
  629. GAME( 1978, deadeye,  0, deadeye,  meadows, 0,        ROT0, "Meadows", "Dead Eye" )
  630. GAME( 1978, gypsyjug, 0, gypsyjug, meadows, gypsyjug, ROT0, "Meadows", "Gypsy Juggler" )
  631.